import axios, { AxiosRequestConfig } from 'axios';
const service = axios.create({
  baseURL: 'http://localhost:4001/api/v1',
});

service.interceptors.request.use(function (config: AxiosRequestConfig<any>) {
  config.headers!['Content-Type'] = 'application/json';
  return config;
});

service.interceptors.response.use(
  function (response) {
    return response.data;
  },
  function (error) {
    return Promise.reject(error);
  }
);
export default service;
